unit SerinosuzGiris;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, FormClassEmptyList, Menus, DB, ADODB, ImgList, XPMan, StdActns,
  ActnList, StdCtrls, Buttons, fcLabel, Grids, Wwdbigrd, Wwdbgrid,
  ExtCtrls, fcStatusBar, Mask, wwdbedit, Wwdotdot;

type
  TfmSerinosuzGiris = class(TfmFormClassEmptyList)
    StokKoduk: TwwDBComboDlg;
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
    procedure FormShow(Sender: TObject);
    procedure StokKodubul(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }                                       
  end;

var
  fmSerinosuzGiris: TfmSerinosuzGiris;

implementation
uses data, UnitOrtak, UnitGenel;
{$R *.dfm}

procedure TfmSerinosuzGiris.FormClose(Sender: TObject;
  var Action: TCloseAction);
begin
  inherited;
  Action := caFree;
  fmSerinosuzGiris := nil;
end;

procedure TfmSerinosuzGiris.FormShow(Sender: TObject);
begin
  inherited;
  OpenQueryOnDataSet(aqEntry.SQL.Text, aqEntry);
end;

procedure TfmSerinosuzGiris.StokKodubul(Sender: TObject);
var
  Bilgi: string;
  StokKod: integer;
  Stokkodu: string[25];
  Cinsi: string[50];
  StokFisiTipi: char;
begin
  Bilgi := StokBul(Sender, 0, StokFisiTipi);

  if Bilgi = '' then
    Exit;

  if Bilgi <> '0' then
  begin
    Stokkod := Strtoint(Copy(Bilgi, 1, Pos(',', Bilgi) - 1));
    Delete(Bilgi, 1, Pos(',', Bilgi));
    Stokkodu := Copy(Bilgi, 1, Pos(',', Bilgi) - 1);


    aqEntry.FieldByName('stokkod').AsInteger := Stokkod;
    aqEntry.FieldByName('stokkodu').AsString := Stokkodu;
  end
  else
  begin
    aqEntry.FieldByName('stokkod').Value := null;
    aqEntry.FieldByName('stokkodu').AsString := '';
  end;
end;

end.

